package zbu.adbook.db;

import zbu.adbook.dao.AddressBookDaoImpl;
import zbu.adbook.dao.AdminDaoImpl;
import zbu.adbook.model.AddressBook;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86183
 */
//测试类
public class Test {
    public static void main(String[] args) throws SQLException {
       /* Connection con = ConnectionManager.getConnection();
        System.out.println(con);*/
        /*int flag = new AdminDaoImpl().login("小王","123456");
        if (flag ==1){
            System.out.println("登陆成功");
        } else if (flag ==2) {
            System.out.println("密码错误");
        }else if (flag ==3) {
            System.out.println("用户名错误");
        }*/
        AddressBookDaoImpl adBookDao = new AddressBookDaoImpl();
       /* int i = adBookDao.delAdBookById(2);
        System.out.println(i);*/
        /*AddressBook adbook1 = new AddressBook(5, "小琦", "女", 19, "18993758289", "2034567821@qq.com", "四川");
        adBookDao.addAdBook(adbook1);*/
       /* AddressBook adBook1 = new AddressBook(3,"小资","女",20,"14567892341","2356798216@qq.com","河南");
        adBookDao.updateAdBook(adBook1);*/
       /* AddressBook adBook2 = adBookDao.getAdBookById(1);
        System.out.println(adBook2);*/
        List<AddressBook> adBook3 = adBookDao.getAddressBookAll();
        for (AddressBook addressBook : adBook3) {
            System.out.println(addressBook);
        }
    }
}
